package com.xzq.bustack.web;

import com.xzq.bustack.netty.NettyServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author xzq
 * @Description //TODO
 * @Date 2021/11/20 12:34
 * @Version 1.0.0
 **/
@RestController
@RequestMapping("/nettyserver")
public class NettyController {

    @Autowired
    private NettyServer nettySerer;

    @RequestMapping("/localAddress")
    public String localAddress() {
        return "netty localAddress " + nettySerer.getChannel().localAddress();
    }

    @RequestMapping("/isOpen")
    public String isOpen() {
        return "netty isOpen " + nettySerer.getChannel().isOpen();
    }
}
